package sardine;

import io.netty.handler.codec.http.HttpResponseStatus;

/**
 * @auth bruce-sha
 * @date 2015/5/21
 */
public class HaltException extends RuntimeException {

    private int statusCode = HttpResponseStatus.OK.code();
    private String body = HttpResponseStatus.OK.reasonPhrase().toString();

    HaltException() {
    }

    HaltException(int statusCode) {
        this.statusCode = statusCode;
    }

    HaltException(String body) {
        this.body = body;
    }

    HaltException(HttpResponseStatus status) {
        this.statusCode = status.code();
        this.body = status.reasonPhrase().toString();
    }

    HaltException(int statusCode, String body) {
        this.statusCode = statusCode;
        this.body = body;
    }

    public int getStatusCode() {
        return statusCode;
    }

    public String getBody() {
        return body;
    }
}
